using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class maplifetime : MonoBehaviour
{
    public Mapcontrol mapcontrol;
    private int mylife;
    // Start is called before the first frame update
    void Start()
    {
        mylife = mapcontrol.map;
    }

    // Update is called once per frame
    void Update()
    {
        if (mylife == mapcontrol.map - 1)
        {
            mapcontrol.havecreatemap = false;
            Destroy(gameObject);
        }
    }
}
